import request from '@/utils/request'
import qs from 'qs'
export function login(username, password, code) {
  return request({
    url: '/api/admin/login.do',
    method: 'post',
    data: qs.stringify({
      username,
      password,
      code
    })
  })
}

export function getInfo() {
  return request({
    url: '/api/admin/permissions.do',
    method: 'get'
  })
}

export function logout() {
  return request({
    url: '/api/admin/logout.do',
    method: "get"
  })
}

export function loginLog(index, pageSize) {
  return request({
    url: '/api/loginLog/list.do',
    method: "get",
    params: {
      index,
      pageSize
    }
  })
}

export function delLog(id) {
  return request({
    url: '/api/loginLog/delete.do',
    method: "get",
    params: {
      ids :id.join("-")
    }
  })
}
